@use 'styles/helpers' as *;
.taskItem {
  position: relative;
  background-color: $color-surface-hover;
  border: 1px solid black;
  border-color: $surface_200;

  // min-height: 100px;

  display: grid;
  grid-template-columns: 20px 1fr;
  padding: 0;

  &.focused {
    border: 1px solid $color-primary;
    background-color: $color-surface-c;
  }

  &.completed {
    border: 1px solid black;
    border-color: $color-surface-border;

    .main {
      color: $color-txt-secondary;
      text-decoration: line-through;
    }
  }

  &:hover {
    .focusBtnWrap {
      visibility: visible;
      opacity: 1;
    }
  }

  &.expanded {
    border: 2px solid $color-primary;
  }
}

.main {
  display: grid;
  grid-template-columns: 50px 1fr;
  grid-template-rows: 1fr;
  padding: 15px 40px 15px 0;

  @include t {
    padding: 10px 20px 10px 0;
    grid-template-columns: 40px 1fr;
  }
}

.checkWrap, .info {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 40px min-content;
  row-gap: 8px;

  @include t {
    grid-template-rows: 30px min-content;
    row-gap: 4px;
  }
}

.checkWrap {
  .checkbox {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.info {
  justify-content: flex-start;
  justify-items: flex-start;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: none;
  border-radius: $border-radius;

  &:hover {
    &::before {
      visibility: visible;
    }
  }

  .description {
    text-align: start;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .title {
    @include title2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: start;

    @include t {
      @include title3;
    }

    &.completed {
      font-weight: 500;
    }
  }
}


//TASK IN EDIT MODE
.infoEdit {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 40px 80px auto;
  row-gap: 8px;
}

.titleEdit {
  position: relative;
  input {
    width: 100%;
  }
}

.descrEdit {
  position: relative;
  textarea {
    width: 100%;
    height: 100%;
  }
}

.limitLabel {
  @include descr2;
  color: $color-txt-secondary;
  opacity: 0.3;
  background-color: $color-surface-ground;
  padding: 4px;
  position: absolute;
  right: 4px;
  bottom: 4px;
}

.titleEdit {
  display: flex;
}

.info::before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  background-color: $color-primary;
  opacity: 0.05;
  visibility: hidden;
}

.removeWrap {
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px;
  transition: opacity 0.2s;
}

.pomodoroStatWrap {
  @include descr2;
  user-select: none;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 2px;

  .pomodoroStatContainer {
    opacity: 0.7;
    padding: 4px 8px;
    color: $color-primary-txt;
    background-color: $color-primary;
    border-radius: $border-radius;
  }
}

.focusBtnWrap {
  // visibility: hidden;
  // opacity: 0;
}

.focusBtn {
  cursor: pointer;
  visibility: visible;
  transition: opacity 0.2s;
  //appereance
  border-top-left-radius: calc($border-radius - 2px);
  border-bottom-left-radius: calc($border-radius - 2px);
  display: flex;
  justify-content: center;
  align-items: center;
  color: $color-txt-secondary;
  opacity: 0.4;

  &:hover {
    color: $color-primary-txt;
    background-color: $color-txt-secondary;
  }

  &.active {
    color: $color-primary-txt;
    visibility: visible;
    opacity: 1;
    background-color: $color-primary;
  }

  &.unavailable {
    visibility: hidden;
    opacity: 0;
  }

  &:disabled {
    opacity: 0;
    visibility: hidden;
  }
}

.editPomodoro {
  position: relative;
  height: 40px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  // background-color: #ffffff;
  border-radius: $border-radius;
  // overflow: hidden;
  //background-image: cross-fade(linear-gradient(0, red, red), linear-gradient(0, transparent, transparent), 0.5);

  &::before {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    // background-color: $color-surface-card;
    opacity: 0.5;
    border-radius: $border-radius;
    // visibility: hidden;
  }
}

.editInputs {
  @include descr1;
  color: $color-txt-secondary;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: auto auto;
  column-gap: 8px;
  justify-content: flex-end;
  justify-items: flex-end;
  button {
    padding: 0 4px !important;
    width: fit-content !important;
    border-radius: 0;

    &:first-child {
      border-top-right-radius: $border-radius;
    }

    &:last-child {
      border-bottom-right-radius: $border-radius;
    }
  }

  input {
    max-width: 45px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-left: 4px;
  }

  .item {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: end;
  }

  @include m {
    @include descr3;
    // display: grid;
    // grid-template-rows: auto auto;
    // grid-template-columns: 1fr;
  }
}

.bottom {
  display: grid;
  grid-template-columns: 1fr min-content;
  column-gap: 12px;

  @include t {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr min-content;
    row-gap: 8px;
    justify-content: flex-end;
    justify-items: flex-end;
  }
}

.submitDummy {
  width: 0px;
  height: 0px;
  visibility: hidden;
  opacity: 0;
}

